#ifndef _CENEMY_H_
#define _CENEMY_H_
#include "Commons.h"
#include "CAnimatedObject.h"
#include "CEnemyParams.h"
#include "cocos2d.h"

/**
 * This class handles enemy movement.
 */
class CEnemy : public CAnimatedObject
{
public:
	CEnemy();
	CEnemy(CEnemyParams enemyParams);
	bool init(cocos2d::CCSpriteBatchNode* pSpriteSheet, b2World* pWorld=NULL);
	void start();
	void collision(float damage);
	void anim(char* state);
	void restoreNormal();
	float getCurrentHealth();
	float getBaseHealth();
	virtual void createBoxBodyForSize(CEnemyParams::EEnemySize size){}
	void createBoxBody();

private:
	/**
	 * Parameters like type, size, health, etc.
	 */
	CEnemyParams 		__enemyParams;

	/**
	 * This action is modified according to current enemy state, i.e. Normal, Hit, Dmg
	 */
	cocos2d::CCAction* 	__pAnimationAction;

	/**
	 * This value is decreased in collision() method according to damage.
	 */
	float 				__currentHealth;

	void addAnimation(char* state);
};

#endif //_CENEMY_H_
